package io.github.biezhi.elves.model;

import io.github.biezhi.elves.utils.StringUtils;
import lombok.Data;

/**
 * 网站验证码对象
 *
 */
@Data
public class CrawlWebsiteVerificationCode {
	//网站地址
	private String websiteUrl = "";
	//验证码提示语，例如：请输入验证码
	private String codePrompt = "";
	//图片标签img元素
	private String imgElement = "";
	//提交按钮元素
	private String submitElement = "";
	//输出文件路径，默认f:/aptcha.jpg;
	private String filePath = "";
	
	public CrawlWebsiteVerificationCode() {}
	public CrawlWebsiteVerificationCode(String websiteUrl, String codePrompt, String imgElement, String submitElement, String filePath) {
		this.websiteUrl = websiteUrl;
		this.codePrompt = codePrompt;
		this.imgElement = imgElement;
		this.submitElement = submitElement;
		this.filePath = filePath;
	}
	
	public String getFilePath() {
		String filePath = "f:/aptcha.jpg";
		if (!StringUtils.isNullOrEmpty(this.filePath)) {
			filePath = this.filePath;
		}
		return filePath;
	}
}